import foo

class CFoo(object):
     def __init__(self):
         self.this = foo.new_CFoo()
         self.thisown = 1
     def __del__(self):
         if self.thisown:
               foo.delete_CFoo(self.this)
     def func():
         return foo.func(self.this)
